<include file="./Application/Admin/View/index/nav.html" />
<script type="text/javascript">
  function firm() {
    if (confirm('确认归还？')) {
      return true;
    } else {
      return false;
    }
  }
</script>
        <div id="page-wrapper">
        <div class="col-md-12 graphs">
	   <div class="xs" style="min-height: 460px;">
  	 <h3>还书</h3>
   <div class="panel-body1">
<script type="text/javascript">
  function checkUser(){
    document.getElementById("formid").submit();
  }
</script>
  <form action="{:U('admin/book/backList')}" method="get" id="formid">
        <div class="input-group">
            <input type="text" name="pname" class="form-control1 input-search" placeholder="请输入还书用户名">
            <span class="input-group-btn">
                <button class="btn btn-success" style="height: 40px;" type="button" onclick="checkUser();"><i class="fa fa-search"></i></button>
            </span>
        </div><!-- Input Group -->
  </form>
   <table class="table nth-child table-striped table-hover">
     <thead>
        <tr>
          <th>#</th>
          <th>书名</th>
          <th>借阅时间</th>
          <th>最晚归还时间</th>
          <th>借阅人</th>
          <th>状态</th>
          <th width="10%">操作</th>
        </tr>
      </thead>
      <tbody>
        <foreach name="backlist" item="b">
        <tr>
          <th scope="row">{$b.id}</th>
          <td>{$b.b_name}</td>
          <td>{$b.addtime|date='Y-m-d H:i:s',###}</td>
          <td>{$b.lasttime|date='Y-m-d H:i:s',###}</td>
          <td>{$b.pname}</td>
          <td>
            <if condition="$b['mark'] eq 0">
              <span style="color: green;">未超时，剩余天数：{$b.residue}</span>
            <else />
              <span style="color: red;">已超时{$b.residue}天</span>
            </if>
          </td>
          <td><a href="{:U('admin/book/backBook',array('id'=>$b['id'],'pname'=>$_GET['pname']))}" onclick="return firm();">归还</a></td>
        </tr>
        </foreach>
      </tbody>
    </table>
    </div>
  </div>
<include file="./Application/Admin/View/index/footer.html" />